<template>
  <div>
    <div class="tasks">
      <div class="subject">任务导航栏</div>
      <div class="item-list">
        <el-row :gutter="20">
          <el-col
            v-for="(item, index) in taskList"
            :key="index"
            :span="5"
          ><div class="grid-content bg-purple" />
            <router-link to="#">
              <div class="tasks-item">
                <div class="icon" :style="`background: ${item.color}`">
                  <i class="el-icon-truck" />
                </div>
                <div class="title">{{ item.name }}</div>
              </div>
            </router-link>
          </el-col>
        </el-row>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      taskList: [
        {
          name: '收货任务',
          color: 'rgb(0, 118, 255)'
        },
        {
          name: '上架任务',
          color: 'rgb(82, 212, 243)'
        },
        {
          name: '盘点任务',
          color: 'rgb(255, 113, 0)'
        },
        {
          name: '拣货任务',
          color: 'rgb(255, 96, 158);'
        },
        {
          name: '交接任务',
          color: 'rgb(255, 178, 0)'
        }
      ]
    }
  }
}
</script>

<style lang="scss" scoped>
.tasks {
  margin-top: 20px;
  width: 100%;
  height: 188px;
  background: #fff;
  box-shadow: 0 0 6px 0 rgb(144 142 142 / 17%);
  border-radius: 12px;
  padding: 25px;
  .subject {
    font-size: 16px;
    font-family: PingFangSC-Semibold, PingFang SC;
    font-weight: 600;
    color: #332929;
    line-height: 22px;
  }
  .tasks-item {
    &:hover {
      background: rgba(255, 255, 255, 0.8);
      box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.06);
      border-radius: 8px;
    }
    margin-top: 19px;
    position: relative;
    width: 100%;
    height: 93px;
    background: #fbf7f7;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-evenly;
    .icon {
      width: 50px;
      height: 50px;
      border-radius: 25px;
      display: flex;
      align-items: center;
      justify-content: space-around;
      i {
        font-size: 28px;
        color: #f8f5f5;
      }
    }
    .title {
      font-size: 16px;
      font-family: PingFangSC-Medium, PingFang SC;
      font-weight: 500;
      color: #332929;
      line-height: 22px;
    }
  }
}
.el-col-5 {
  width: 20%;
}
</style>
